Skip to content

Conversation

Utkarsh-Karambhe
Copy link

Issue

In 03_Grouping/Alcohol_Consumption/Exercise_with_solutions.ipynb, Step 6 (drinks.groupby('continent').mean()) raises a TypeError in modern pandas versions (e.g., 2.x) due to attempting to compute the mean of the non-numeric country column.

Fix

Updated the code to drinks.groupby('continent').mean(numeric_only=True) to exclude non-numeric columns, ensuring compatibility with pandas 2.x.

Impact

This fixes the error and aligns the solution with current pandas behavior, improving the exercise for learners.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant